/*
* $Id: Interfaces.h 143 2010-09-09 19:55:18Z volok-aleksej@yandex.ru $
*
* Copyright 2009-2009 by Volokitin Aleksey
* All rights reserved
*
*/
#ifndef _INTERFACES_H_
#define _INTERFACES_H_

interface IDatabase;
interface ISetting;

interface IBase{
	virtual void Free() = 0;
};

interface IWnd : public IBase{
	virtual long Send(unsigned int nMessage, unsigned int wParam, long lParam) = 0;
	virtual bool Post(unsigned int nMessage, unsigned int wParam, long lParam) = 0;
	virtual void Redraw() = 0;
	virtual bool IsCreate() = 0;
	virtual int GetWinId() = 0;
	virtual void Resize(int x, int y, int cx, int cy) = 0;
	virtual void Focus() = 0;
};

interface IVisualComponent : public IBase{
	virtual IWnd* GetButtonInMainWindow() = 0;
	virtual void CreateComponentFrame() = 0;
	virtual IWnd* GetComponentFrame() = 0;
	virtual void UpdateComponent() = 0;
};

interface IVisualManager{
	static IVisualManager* GetVisualManager();
	virtual void Init() = 0;
	virtual IWnd* GetMainWindow() = 0;
	virtual IVisualComponent* GetVisualComponent(const std::tstring& strComponentName) = 0;
	virtual void UpdateVisualComponents() = 0;
};

interface ISettingsManager{
	static ISettingsManager* GetSettingsManager();
	virtual void Init() = 0;
	virtual std::vector<ISetting*> GetSettings() = 0;
	virtual std::vector<ISetting*> GetSettings(const std::tstring& strComponentName) = 0;
	virtual ISetting* GetSetting(const std::tstring& strSettingName) = 0;
};

interface ILanguageManager{
	static ILanguageManager* GetLanguageManager();
	virtual void Init() = 0;
	virtual std::tstring GetString(int nType, const std::tstring& strLang = _T("")) = 0;
	virtual std::vector<std::tstring> GetSupportLanguage() = 0;
	virtual std::tstring GetDefaultLanguage() = 0;
	virtual std::tstring GetCurrentLanguage() = 0;
	virtual std::tstring GetConstant(const std::tstring& strConstName, const std::tstring& strLang = _T("")) = 0;
};

interface IDatabaseManager{
	static IDatabaseManager* GetDatabaseManager();
	virtual void Initialize() = 0;
	virtual IDatabase* OpenDatabase(const std::tstring& strNameDatabase) = 0;
	virtual void CloseDatabase(IDatabase* pDatabase) = 0;
};

interface ISubscriber{
	virtual void EventHandler() = 0;
};

interface IEventManager{
	static IEventManager* GetEventManager();
	virtual void SendEvent(int nIdEvent) = 0;
	virtual void SubscribeEvent(ISubscriber* pSubscriber, int nIdEvent) = 0;
	virtual void UnSubscribeEvent(ISubscriber* pSubscriber, int nIdEvent) = 0;
};

interface IComponent : public IBase{
	virtual void Init() = 0;
	virtual std::tstring GetNameComponent() = 0;
	virtual std::vector<ISetting*> GetSettings() = 0;
	virtual IVisualComponent* GetVisualComponent() = 0;
};

interface IApplication : public IBase{
	static IApplication* GetApp();
	virtual std::vector<IComponent*> GetComponents() = 0;
};

#endif/*_INTERFACES_H_*/